Go to the source code of this file.
|
| int | MbimTransport_Initialize (MbimTransport *pThis, char *devicePath, uint32_t maxExpectedInformationLength) |
| |
| void | MbimTransport_ShutDown (MbimTransport *pThis) |
| |
| int | MbimTransport_SendCommand (MbimTransport *pThis, const uint8_t *deviceServiceId, uint32_t cid, uint32_t commandType, uint8_t *informationBuffer, uint16_t informationBufferLength, MbimTransaction *pTransaction) |
| |
| uint32_t | MbimTransport_GetNextTransactionId (MbimTransport *pThis) |
| |
| void | MbimTransport_CancelTransaction (MbimTransport *pThis, uint32_t transactionId) |
| |
| void | MbimTransport_AttachIndicator (MbimTransport *pThis, MbimIndicator *pIndicator) |
| |
| void | MbimTransport_DetachIndicator (MbimTransport *pThis, MbimIndicator *pIndicator) |
| |
| #define MBIM_COMMAND_TYPE_QUERY 0 |
| #define MBIM_COMMAND_TYPE_SET 1 |
Max CIDs per device service. Chosen with some head-room. Current max is 25.
| #define MBIM_MAX_CTRL_TRANSFER 4096 |
This value should be determined at run-time.
| #define MBIM_STATUS_FAILURE 2 |
Standard MBIM return code failure.
| #define MBIM_STATUS_SUCCESS 0 |
Standard MBIM return code success.
| #define MBIM_UUID_SIZE 16 |
Number of bytes in a MBIM device service's UUID
This structure abstracts a MBIM transport layer. It is responsible for applying MBIM headers to packets destined for MBIM device services and forwarding them to the device. It is responsible for receiving MBIM packets from the device. On the basis of MBIM headers, it assembles multi-fragment responses and indications and delivers them back to user.
- Parameters
-
| deviceFd |
- File descriptor of device.
|
| shutdownFd |
- Event descriptor. Used to signal read thread to terminate.
|
| writeLock |
- Provides mutual exclusion for write operations.
|
| readThread |
- Thread responsible for reading from device.
|
| transactionId |
- MBIM transaction ID. Upper limit 0xffffffff. Never 0. Increments for each transaction.
|
| transactionIdLock |
- Mutex to make transactionId access thread-safe.
|
| transactionList |
- Head of linked list of outstanding transactions.
|
| transactionListLock |
- Provides thread safety for the transaction list.
|
| pIncomingMessage |
- Private workspace to assemble incoming information fragments.
|
| indicatorList |
- Head of linked list of indicators which are called when MBIM indications are received.
|
| indicatorListLock |
- Provides thread safety for the indicators list.
|
Attaches a MBIM indicator to this MBIM transport object.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | pIndicator | Indicator to be attached. |
| void MbimTransport_CancelTransaction |
( |
MbimTransport * |
pThis, |
|
|
uint32_t |
transactionId |
|
) |
| |
Cancel an outstanding MBIM transaction.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | transactionId | ID of transaction to be cancelled. |
Detaches a MBIM indicator to this MBIM transport object.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | pIndicator | Indicator to be detached. |
| uint32_t MbimTransport_GetNextTransactionId |
( |
MbimTransport * |
pThis | ) |
|
Returns next transaction ID for MBIM transport.
- Parameters
-
| [in] | pThis | The primary object of this call. |
- Returns
- transaction ID
| int MbimTransport_Initialize |
( |
MbimTransport * |
pThis, |
|
|
char * |
devicePath, |
|
|
uint32_t |
maxExpectedInformationLength |
|
) |
| |
Initialize this MBIM transport object.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | devicePath | Absolute path to device. |
| [in] | maxExpectedInformationLength | Maximum expected length of information content. |
- Returns
- 0 on success, < 0 on failure.
- Note
- maxExpectedInformationLength is used to allocate a buffer for assembling fragments for incoming command responses and indications.
| int MbimTransport_SendCommand |
( |
MbimTransport * |
pThis, |
|
|
const uint8_t * |
deviceServiceId, |
|
|
uint32_t |
cid, |
|
|
uint32_t |
commandType, |
|
|
uint8_t * |
informationBuffer, |
|
|
uint16_t |
informationBufferLength, |
|
|
MbimTransaction * |
pTransaction |
|
) |
| |
Send a MBIM command to the device and return immediately.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | deviceServiceId | Device service UUID which is recipient of command. |
| [in] | cid | Command ID (CID) which is specific to that device service. |
| [in] | commandType | 1 = set, 0 = get. |
| [in] | informationBuffer | Buffer of information content. |
| [in] | informationBufferLength | Size in bytes of information content. |
| [in] | pTransaction | Transaction object which will track the command/response. |
- Returns
- 0 on success, < 0 on failure.
- Note
- pTransaction must have been initialized with MbimTransaction_Initialize prior to this call.
Shut down this MBIM transport object.
- Parameters
-
| [in] | pThis | The primary object of this call. |